#include "head.h"

MainWindow::MainWindow(QWidget *parent)
    :QWidget(parent)
{
    setMinimumSize(QSize(1280, 910));
    setFixedSize(QSize(1280, 910));
    setAutoFillBackground(true);
    setAttribute(Qt::WA_TranslucentBackground, true);
    loadWidget();
}

void MainWindow::loadWidget()
{
    auto qv = new QVBoxLayout();
    qv->setContentsMargins(0, 0, 0, 0);
    qv->setSpacing(0);

    _myScreen = new Screen();
    qv->addWidget(_myScreen, 9);

    _myControl = new Control();

    connect(_myScreen, SIGNAL(reset()), _myControl, SLOT(reset()));
    connect(_myScreen, SIGNAL(initDuration(double)), _myControl, SLOT(acceptDuration(double)));
//    _myControl->setMinimumSize(QSize(width(), 180));
    qv->addWidget(_myControl, 1);

    connect(_myControl, SIGNAL(adjustProgress(double)), _myScreen, SLOT(acceptProgress(double)));
    setLayout(qv);
}

MainWindow::~MainWindow()
{

}
